﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AgileTimeTracker.Domain.TfsModule;
using AgileTimeTracker.Domain.UserModule;
using AgileTimeTracker.Infra.Repository.File;
using AgileTimeTracker.Infra.Repository.Tfs;

namespace AgileTimeTracker.Client.Wpf.Services
{
    public abstract class BaseService
    {
        private IUserRepository userRepository;

        private ITfsRepository tfsRepository;

        public BaseService()
        {
        }

        protected IUserRepository UserRepository
        {
            get
            {
                if (this.userRepository == null)
                {
                    this.userRepository = new UserRepository(Wpf.Properties.Settings.Default.ConfigInfoFile);
                }

                return this.userRepository;
            }
        }

        protected ITfsRepository TfsRepository
        {
            get
            {
                if(this.tfsRepository == null)
                {
                    this.tfsRepository = new TfsRepository();
                }

                return this.tfsRepository;
            }
        }
    }
}
